diCIUserCancelErr = 1, /* user cancelled the disk init */
diCICriticalSectorBadErr = 20, /* critical sectors are bad (hopeless) */
diCISparingFailedErr = 21, /* disk cannot be spared */
diCITooManyBadSectorsErr = 22, /* too many bad sectors */
diCIUnknownVolTypeErr = 23, /* the volume type passed in diCIExtendedZero paramBlock is not supported */
diCIVolSizeMismatchErr = 24, /* specified volume size doesn’t match with formatted disk size */
diCIUnknownDICallErr = 25, /* bogus DI function call selector */
diCINoSparingErr = 26, /* disk is bad but the target FS doesn't do disk sparing */
diCINoExtendInfoErr = 27, /* missing file system specific extra parameter in diCIExtendedZero call */
diCINoMessageTextErr = 28 /* missing message text in DIReformat call */
};
/*
* File System Manager constants
*/
/*
* Miscellaneous constants used by FSM
*/
enum {
fsdVersion1 = 1, /* current version of FSD record */
fsmIgnoreFSID = 0xfffe, /* this FSID should be ignored by the driver */
fsmGenericFSID = 0xffff /* unknown foreign file system ID */
};
/*
* compInterfMask bits common to all FSM components
*/
enum {
fsmComponentEnableBit = 31, /* set if FSM component interface is enabled */
fsmComponentEnableMask = 0x80000000,
fsmComponentBusyBit = 30, /* set if FSM component interface is busy */
fsmComponentBusyMask = 0x40000000
};
/*
* Selectors for GetFSInfo
*/
enum {
fsmGetFSInfoByIndex = -1, /* get fs info by index */
fsmGetFSInfoByFSID = 0, /* get fs info by FSID */
fsmGetFSInfoByRefNum = 1 /* get fs info by file/vol refnum */
};
/*
* InformFSM messages
*/
enum {
fsmNopMessage = 0, /* nop */
fsmDrvQElChangedMessage = 1, /* DQE has changed */
fsmGetFSIconMessage = 2 /* Get FFS's disk icon */
};
/*
* Messages passed to the fileSystemCommProc
*/
enum {
ffsNopMessage = 0, /* nop, should always return noErr */
ffsGetIconMessage = 1, /* return disk icon and mask */
ffsIDDiskMessage = 2, /* identify the about-to-be-mounted volume */
ffsLoadMessage = 3, /* load in the FFS */
ffsUnloadMessage = 4, /* unload the FFS */
ffsIDVolMountMessage = 5, /* identify a VolMountInfo record */
ffsInformMessage = 6, /* FFS defined message */
ffsGetIconInfoMessage = 7
};
/*
* Error codes from FSM functions
*/
enum {
fsmFFSNotFoundErr = -431, /* Foreign File system does not exist - new Pack2 could return this error too */
fsmBusyFFSErr = -432, /* File system is busy, cannot be removed */
fsmBadFFSNameErr = -433, /* Name length not 1 <= length <= 31 */
fsmBadFSDLenErr = -434, /* FSD size incompatible with current FSM vers */
fsmDuplicateFSIDErr = -435, /* FSID already exists on InstallFS */
fsmBadFSDVersionErr = -436, /* FSM version incompatible with FSD */
fsmNoAlternateStackErr = -437, /* no alternate stack for HFS CI */
fsmUnknownFSMMessageErr = -438 /* unknown message passed to FSM */
};
/*
* HFS Utility routine records
*/
/*
* record used by UTGetPathComponentName
*/
struct ParsePathRec {
StringPtr namePtr; /* pathname to parse */
short startOffset; /* where to start parsing */
short componentLength; /* the length of the pathname component parsed */
SignedByte moreName; /* non-zero if there are more components after this one */
SignedByte foundDelimiter; /* non-zero if parsing stopped because a colon (:) delimiter was found */
};
typedef struct ParsePathRec ParsePathRec;
typedef ParsePathRec *ParsePathRecPtr;
struct WDCBRec {
VCBPtr wdVCBPtr; /* Pointer to VCB of this working directory */
long wdDirID; /* Directory ID number of this working directory */
long wdCatHint; /* Hint for finding this working directory */
long wdProcID; /* Process that created this working directory */
};
typedef struct WDCBRec WDCBRec;
typedef WDCBRec *WDCBRecPtr;
struct FCBRec {
unsigned long fcbFlNm; /* FCB file number. Non-zero marks FCB used */
SignedByte fcbFlags; /* FCB flags */
SignedByte fcbTypByt; /* File type byte */
unsigned short fcbSBlk; /* File start block (in alloc size blks) */
unsigned long fcbEOF; /* Logical length or EOF in bytes */
unsigned long fcbPLen; /* Physical file length in bytes */
unsigned long fcbCrPs; /* Current position within file */
VCBPtr fcbVPtr; /* Pointer to the corresponding VCB */
Ptr fcbBfAdr; /* File's buffer address */
unsigned short fcbFlPos; /* Directory block this file is in */
/* FCB Extensions for HFS */
unsigned long fcbClmpSize; /* Number of bytes per clump */
Ptr fcbBTCBPtr; /* Pointer to B*-Tree control block for file */
unsigned long fcbExtRec[3]; /* First 3 file extents */
OSType fcbFType; /* File's 4 Finder Type bytes */
unsigned long fcbCatPos; /* Catalog hint for use on Close */
unsigned long fcbDirID; /* Parent Directory ID */
Str31 fcbCName; /* CName of open file */
};
typedef struct FCBRec FCBRec;
typedef FCBRec *FCBRecPtr;
/*
* HFS Component Interface records
*/
typedef pascal OSErr (*Lg2PhysProcPtr)(void *fsdGlobalPtr, VCBPtr volCtrlBlockPtr, FCBRecPtr fileCtrlBlockPtr, short fileRefNum, unsigned long filePosition, unsigned long reqCount, unsigned long *volOffset, unsigned long *contiguousBytes);
extern pascal OSErr UTTrashFileBlocks(VCBPtr volCtrlBlockPtr, unsigned long fileNum)
TWOWORDINLINE(0x7025, 0xA824);
extern pascal OSErr UTTrashBlocks(unsigned long beginPosition, unsigned long byteCount, VCBPtr volCtrlBlockPtr, short fileRefNum, short tbOption)
TWOWORDINLINE(0x7026, 0xA824);
extern pascal OSErr UTCacheReadIP(void *log2PhyProc, unsigned long filePosition, Ptr ioBuffer, short fileRefNum, unsigned long reqCount, unsigned long *actCount, short cacheOption)
TWOWORDINLINE(0x7027, 0xA824);
extern pascal OSErr UTCacheWriteIP(void *log2PhyProc, unsigned long filePosition, Ptr ioBuffer, short fileRefNum, unsigned long reqCount, unsigned long *actCount, short cacheOption)
TWOWORDINLINE(0x7028, 0xA824);
extern pascal OSErr UTBlockInFQHashP(short vRefNum, unsigned long diskBlock)
TWOWORDINLINE(0x702C, 0xA824);
/*
* File System Manager call prototypes
*/
extern pascal OSErr InstallFS(FSDRecPtr fsdPtr);
extern pascal OSErr RemoveFS(short fsid);
extern pascal OSErr SetFSInfo(short fsid, short bufSize, FSDRecPtr fsdPtr);
extern pascal OSErr GetFSInfo(short selector, short key, short *bufSize, FSDRecPtr fsdPtr);